const http = require("http");
const express = require("express");
const socketIo = require("socket.io");
const app = express();
const httpServer = http.createServer(app);
app.use(express.static(__dirname));
const io = socketIo(httpServer);
io.on("connection",function(socket){
    console.log("connection-创建连接成功！",socket.id);
    setInterval(()=>{
        socket.emit("two","常","雲","贺");
    },3000)
    socket.on("one",function(a,b,c,d){
        console.log("接收到了浏览器向我发送的消息",a,b,c,d)
    })
    socket.on("disconnect",function(){
        console.log("断开连接！",socket.id);
    })
})
httpServer.listen(80,()=>{
    console.log("success");
})